#ifndef MAP_H
#define MAP_H
#include <utility>
#include "Unit.hpp"
#include <iostream>
#include <stdlib.h>



class Map
{
    public:
        Map( short size_x = 21 , short size_y = 21 );
        virtual ~Map();
        Unit* getUnitAt(short x,short y) const;
        short  getGroundAt(short x,short y) const;
        bool setUnitAt(short x,short y, Unit* newunit );
        bool setUnitAt(sf::Vector2i pos, Unit* newunit );
        bool setGroundAt(short x,short y, short newground );

        short getSizeX() const { return m_size_x ;};
        short getSizeY() const { return m_size_y ;};

        bool isInsideMap(short x, short y) const {
            if ( x  >= 0 && x < m_size_x && y >= 0 && y  < m_size_y )
                return true ;
            return false ;
        }

    protected:
    private:

        short m_size_x ;
        short m_size_y ;

        std::vector< std::vector< std::pair< short,  Unit*> > > m_map ;
};

#endif // MAP_H
